home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / musik / MIDIFP21 / SOURCES / MIDI_PRT / DRAWER / DRAWER.PIF < prev   
Encoding:
Text File  |  1996-08-18  |  5.3 KB  |  167 lines

  1. /**************************************************************
  2. *
  3. *                DRAWER.PIF
  4. *
  5. **************************************************************/
  6.  
  7. /*** page selecting mode for select_page() ***/
  8.  
  9. typedef enum {first, last, next, previous, same} SELECT_MODE ;
  10.  
  11. /*** init data for drawer constructor ***/
  12.  
  13. typedef struct 
  14. {
  15.     CICONBLK *icon ;
  16.     char *filename ;
  17.     int handle ;
  18.     Awindow *obj_wi ;
  19.     int obj ;
  20.     int width ;
  21.     int height ;
  22.     Awindow *params_window, *filter_window, *info_window ;
  23. DRAWER_INIT ;
  24.  
  25. /*******************************************************************
  26. */
  27.     Awindow *DRAWER_constructor(DRAWER_INIT *) ;
  28. /*    
  29. *  Constructor of the DRAWER object. 
  30. * INPUT:   init values, see above
  31. * OUTPUT:  drawer icon on screen 
  32. * RETURN:  errors: NULL or -if successfull- ACS-window pointer,
  33. *          which will be used as handle for the object instance
  34. *******************************************************************/
  35.  
  36. /*******************************************************************
  37. */
  38.     void DRAWER_destructor(Awindow *) ;
  39.     
  40. /* Destructor of the DRAWER object. 
  41. * INPUT:   *window:  ACS-window to destruct
  42. *******************************************************************/
  43.  
  44. /*******************************************************************
  45. */
  46.     void draw_page(
  47.         int handle,         /* VDI worksatation handle */
  48.         Awindow *window,     /* data of affected drawer instance */
  49.         int x,                 /* x-offset of drawing */
  50.         int y,                 /* y-offset of drawing */
  51.         int *points,         /* 2 clipping points */
  52.         int zoom,             /* zooming factor */
  53.         int page            /* page number */
  54.     ) ;               
  55. /*
  56. * OUTPUT:  drawing on VDI workstation
  57. *******************************************************************/
  58.  
  59. /*******************************************************************
  60. */
  61.     void select_page(Awindow *wi, SELECT_MODE sm) ;
  62.     
  63. /* Adjusts the page number to the desired one
  64. *  and draws the corresponding page.
  65. * INPUT:   window: all data of the affected drawer instance
  66. *          sm:     SELECT_MODE, see above
  67. * OUTPUT:  d->current_page: updated current page number
  68. *                           according sm
  69. *          redrawn drawer window
  70. *          redrawn note systems
  71. *******************************************************************/
  72.  
  73. /*******************************************************************
  74. */
  75.     int page_layouter(
  76.         int handle,         /* VDI worksatation handle */
  77.         int width,             /* width of pages to fit drawing */
  78.         int height,         /* height ... */
  79.         Awindow *window        /* instance */
  80.     ) ;
  81.     
  82. /* Calculates the layout of all pages. The number
  83. *  of pages depends on the current parameters.
  84. *  The layouter only needs to be called when parameters have
  85. *  changed, thus CPU time can be saved (i.e. the layouter 
  86. *  should not always be called before drawing).
  87. * OUTPUT:  (d->x_min/d->y_min) and (d->x_max/d->y_max) are border
  88. *          points of the allowed drawing area (allowed by the 
  89. *          parameters object).
  90. *          (d->x_min_systems/d->y_min_systems) and 
  91. *          (d->x_max_systems/d->y_max_systems) are border
  92. *          points of the drawing area for note systems 
  93. *          (without headline, indeces).
  94. *          d->npgs:             number of pages layouted
  95. *          d->beats_per_system: beats_per_system
  96. *          d->time_per_system:  time per system in [ticks] 
  97. *          d->bars_per_system:  bars_per_system
  98. *          d->bar_divider:      sub-bars per bar
  99. *          d->dx_bars:          x-distance between bars
  100. *          d->dy_system:        y-distance between different systems
  101. *          d->dy_track:         y-distance between different tracks
  102. *          d->dy_line:          y-distance between note lines
  103. *          d->dy_note:          y-distance between notes
  104. *          d->font_id:          ID of GDOS font
  105. *          d->page[0..n]:       correctly updated
  106. * RETURN:  
  107. */
  108.             #define LAYOUT_ERR -1  
  109.             #define LAYOUT_GOOD 1  
  110. /* 
  111. *******************************************************************/
  112.  
  113. /*******************************************************************
  114. */
  115.     void reset_layout(Awindow *window) ;
  116.     
  117. /* Calls the "page_layouter" with the screen workstation's
  118. *  maximum possible width and height.
  119. * INPUT:   window:       affected drawer instance
  120. * OUTPUT:  see "page_layouter"
  121. *******************************************************************/
  122.  
  123. /*******************************************************************
  124. */
  125.     void redraw(Awindow *wi) ;
  126.     
  127. /* Causes a new layouting with current parameters
  128. *  and a succeeding redrawing.
  129. * INPUT:   *wi: drawer window instance
  130. * OUTPUT:  - updated drawer object data, see "page_layouter"
  131. *          - redrawn note systems on screen
  132. *******************************************************************/
  133.  
  134. /*******************************************************************
  135. */
  136.     int get_first_page(Awindow *window) ;
  137.     int get_last_page(Awindow *window) ;
  138.     int get_current_page(Awindow *window) ;
  139.     
  140. /* Access procedures to the drawer object data. 
  141. * INPUT:   *wi: drawer window instance with data to be updated
  142. * RETURN:  page number of first/last displayable resp. currently
  143. *          displayed page
  144. *******************************************************************/
  145.